package cj.com.chabaike.ui.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;

import jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout;

/**
 * Created by CJLAB on 2015/8/12.
 */
public class HeaderLinearLayout extends LinearLayout {

    WaveSwipeRefreshLayout mWaveSwipeRefreshLayout;
    ViewPager headerViewPager;

    public void setHeaderViewPager(ViewPager headerViewPager) {
        this.headerViewPager = headerViewPager;
    }

    public HeaderLinearLayout(Context context) {
        super(context);
    }

    public HeaderLinearLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public HeaderLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

   // public HeaderLinearLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
   //     super(context, attrs, defStyleAttr, defStyleRes);
  //  }
public  void setmWaveSwipeRefreshLayout(WaveSwipeRefreshLayout mWaveSwipeRefreshLayout){
    this.mWaveSwipeRefreshLayout=mWaveSwipeRefreshLayout;

}



    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        mWaveSwipeRefreshLayout.setisPullDown(false);
        Log.e("HeaderLinearLayout", "mWaveSwipeRefreshLayout已设置");
        Log.e("HeaderLinearLayout", "dispatchTouchEvent headerViewPager   ====" + headerViewPager.getCurrentItem());
       return super.dispatchTouchEvent(ev);
       // return  true;

    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.e("HeaderLinearLayout", "onTouchEvent headerViewPager   ====" + headerViewPager.getCurrentItem());

        return super.onTouchEvent(event);
    }

    @Override
    public boolean callOnClick() {
        Log.e("HeaderLinearLayout", "callOnClick headerViewPager   ====" + headerViewPager.getCurrentItem());
        return super.callOnClick();
    }
}
